/*
 * MODULE NAME:    mgr_secdb.h
 * DESCRIPTION:    Host Manager Bounding Functionality
 * AUTHOR:         Tom Howley
 * DATE:           30 June 2000
 *
 * SOURCE CONTROL: $Id:
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2002 RDA Microelectronics.
 *     All rights reserved.
 *
 */

#ifndef __MGR_SECDB_H
#define __MGR_SECDB_H

/* authority mode */
#define MGR_UNKNOWN   0
#define MGR_UNTRUSTED 1
#define MGR_TRUSTED   2

/* encryption mode */
#define CRPYT_DISABLED	0
#define CRYPT_P2PONLY	1
#define CRYPT_ALL	2

#define BOND_INACTIVE				1
#define BOND_AUTH_PENDING			2	
#define BOND_CONN_PENDING			3
#define BOND_NAME_PENDING			4
#define BOND_AUTH_CONN_PENDING		5
#define BOND_RELEASE_CONN_PENDING	6

#define ACCESS_REQ_IDLE    1
#define ACCESS_REQ_AUTH_PENDING 2
#define ACCESS_REQ_PAIR_PENDING 3
#define ACCESS_REQ_ENCRYPT_PENDING 4
#define ACCESS_REQ_SUCESS    5

/* Direction of Access Requests */
#define MGR_INCOMING 0
#define MGR_OUTGOING 1

/* Security Level Define */
#define MGR_ACCESS_REGECT         0xff
#define MGR_MITM_ENCRYPTION         3
#define MGR_NOMITM_ENCRYPTION       2
#define MGR_NOMITM_MIN_USERIF     1
#define MGR_NOUSER_INTERACTION      0       // only for sdp

#define L2CAP_PROTOCOLID  1         // use psm as channel id
#define RFCOMM_PROTOCOLID 2      // use service class uuid as channel id
#define SDP_PROTOCOLID    3
#define TCSBIN_PROTOCOLID 4

#ifndef _PARTHUS_SEC_TYPES_
enum ssp_sec_Auth_req
{
    MITM_NOT_REQ_NO_BONDING         = 0,
    MITM_REQ_NO_BONDING             = 1,
    MITM_NOT_REQ_DEDICATED_BONDING  = 2,
    MITM_REQ_DEDICATED_BONDING      = 3,
    MITM_NOT_REQ_GENERAL_BONDING    = 4,
    MITM_REQ_GENERAL_BONDING        = 5
};
#endif

/* Service Registration functions */
APIDECL1 t_api APIDECL2 MGR_RegisterServiceSecurityLevel(u_int8 protocolId, u_int16 channelId, u_int8 securityLevel);

/* Access Request functions */
APIDECL1 t_api APIDECL2 MGR_OutgoingAccessRequest(u_int8 protocolId, u_int16 channelId, t_bdaddr address, u_int32 cbHandle);
APIDECL1 t_api APIDECL2 MGR_IncomingAccessRequest(u_int8 protocolId, u_int16 channelId, t_bdaddr address, u_int32 cbHandle);

/* Service Database Access */
APIDECL1 t_api APIDECL2 MGR_FlushSecurityDatabase(u_int32 flags);


void rdabt_mgr_handle_security_hciEvent(t_DataBuf *buff);

#endif /*__MGR_SECDB_H */
